﻿Expense = function (dataUrlRoot, dataUrlChildren) {
    $('#jstree').jstree({
        "core": {
            "animation": 0,
            "check_callback": true,
            "themes": { "stripes": true },
            'data': {
                'url': function (node) {
                    return node.id === '#' ?
                      dataUrlRoot : dataUrlChildren;
                },
                'data': function (node) {
                    return { 'id': node.id };
                }
            }
        },
        "types": {
            "#": {
                "max_children": 1,
                "max_depth": 4,
                "valid_children": ["root"]
            },
            "root": {
                "icon": "glyphicon glyphicon-file",
                "valid_children": ["default"]
            },
            "default": {
                "valid_children": ["default", "file"]
            },
            "file": {
                "icon": "glyphicon glyphicon-file",
                "valid_children": []
            }
        },
        "plugins": [
          "contextmenu", "dnd", "search",
          "state", "types", "wholerow"
        ]
    });
}